<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$store_info.store_name}-{$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/layui/css/layui.css"/>
    <script src="__TMPL__/public/layui/layui.js"></script>
    <style>
        .layui-flow-more{width: 100%!important;outline: none!important;background-color:#F2F2F2!important;padding: 10px 0!important;margin:0!important; }
    </style>

</head>
<body>
<div id="content1">
    <div class="shop" style="background-image: url({:cmf_get_image_preview_url($store_info.more.thumbnail)});">
        <div class="top">
            <span class="ads_name" onclick="get_store(1)">{$store_info.store_name}</span>
            <span onclick="get_store(1)"><img src="__TMPL__/public/assets/img/down.png"/></span>
            <div class="open">
               <!-- <img src="__TMPL__/public/assets/img/share.png"/>
                <img src="__TMPL__/public/assets/img/dian.png"/>-->
            </div>
        </div>



        <div class="shopdetail">
            <div class="time">
                <span>{$store_info.time}</span>
            </div>
            <div class="address">
                <div><p><a href="{:url('shop/index/baidu_search',array('id'=>$store_id))}" style="color: #000">{$store_info.address}</a></p></div>
                <div class="phone" onclick="location.href='tel:{$store_info.phone}'"></div>
            </div>
        </div>
    </div>
  <php>if(isset($store_info['more']['photos'])){</php>
    <div class="show">
        <div class="cdname"><img src="__TMPL__/public/assets/img/solid1.png"/><span>门店展示</span><img src="__TMPL__/public/assets/img/solid2.png"/></div>  
      		<div class="showbox">
                <foreach name="$store_info['more']['photos']" item="vo">
                    <div class="showimg">
                        <div><img src="{:cmf_get_image_preview_url($vo.url)}" title="{$vo.name}"/></div>
                    </div>
                </foreach>
            </div>
    </div>
   <php>}</php>

    <php>
        $seven_content='';
        $seven_price='';
        $seven_score='';
        $monthly_content='';
        $monthly_price='';
        $monthly_score='';
        $half_year_content='';
        $half_year_price='';
        $half_year_score='';
        $year_content='';
        $year_price='';
        $year_score='';
    </php>
    <foreach name="card_info" item="v">
        <php>

            if($v['type']==1){
            $seven_content=isset($v['card_info'])?$v['card_info']:'';
            $seven_price=isset($v['price'])?$v['price']:'';
            $seven_score=isset($v['score'])?$v['score']:'';
            $seven_id=isset($v['card_id'])?$v['card_id']:'';
            }
            if($v['type']==2){
            $monthly_content=isset($v['card_info'])?$v['card_info']:'';
            $monthly_price=isset($v['price'])?$v['price']:'';
            $monthly_score=isset($v['score'])?$v['score']:'';
            $monthly_id=isset($v['card_id'])?$v['card_id']:'';
            }
            if($v['type']==3){
            $half_year_content=isset($v['card_info'])?$v['card_info']:'';
            $half_year_price=isset($v['price'])?$v['price']:'';
            $half_year_score=isset($v['score'])?$v['score']:'';
            $half_year_id=isset($v['card_id'])?$v['card_id']:'';
            }
            if($v['type']==4){
            $year_content=isset($v['card_info'])?$v['card_info']:'';
            $year_price=isset($v['price'])?$v['price']:'';
            $year_score=isset($v['score'])?$v['score']:'';
            $year_id=isset($v['card_id'])?$v['card_id']:'';
            }
        </php>
    </foreach>
    <notempty name="card_info">
    <div class="slidebox">
        <div class="cdname"><img src="__TMPL__/public/assets/img/solid1.png"/><span>会员卡</span><img src="__TMPL__/public/assets/img/solid2.png"/></div>
        <div class="slide">
            <eq name="store_info.seven_days_card" value="1">
                <div class="slide-item test" onclick="location.href='{:url(\'shop/order/index_card\',array(\'id\'=>$seven_id))}'">
                    <div class="slideitembox">
                    <div></div>
                    <p>体验卡</p>
                    <p>{$seven_content}</p>
                    <p><span class="rmb">￥</span><span>{$seven_price}</span></p>
                </div>
                </div>
            </eq>
            <eq name="store_info.monthly_card" value="1">
                <div class="slide-item halfyear" onclick="location.href='{:url(\'shop/order/index_card\',array(\'id\'=>$monthly_id))}'">
                    <div class="slideitembox">
                    <div></div>
                    <p>半年卡</p>
                    <p>{$monthly_content}</p>
                    <p><span class="rmb">￥</span><span>{$monthly_price}</span></p>
                </div>
                </div>
            </eq>
            <eq name="store_info.half_year_card" value="1">
                <div class="slide-item year" onclick="location.href='{:url(\'shop/order/index_card\',array(\'id\'=>$half_year_id))}'">
                    <div class="slideitembox">
                    <div></div>
                    <p>年卡</p>
                    <p>{$half_year_content}</p>
                    <p><span class="rmb">￥</span><span>{$half_year_price}</span></p>
                </div>
                </div>
            </eq>
            <eq name="store_info.year_card" value="1">
                <div class="slide-item year2" onclick="location.href='{:url(\'shop/order/index_card\',array(\'id\'=>$year_id))}'">
                    <div class="slideitembox">
                    <div></div>
                    <p>家庭股东年卡</p>
                    <p>{$year_content}</p>
                    <p><span class="rmb">￥</span><span>{$year_price}</span></p>
                </div>
                </div>
            </eq>
        </div>
    </div>
    </notempty>

    <div class="market">
        <div class="market_title">
            <img src="__TMPL__/public/assets/img/solid1.png"/><span>积分兑换</span><img src="__TMPL__/public/assets/img/solid2.png"/>
        </div>
        <div class="market_list" id="LAY_demo1">

        </div>
    </div>
    <p class="nomore"></p>
    <include file="public@footer"/>
    <div id="allmap" style="width: 0;height: 0;display: none;"></div>
    <php>
        if(cookie('store_id')){
            echo "<script>var store=true;</script>";
        }else{
            echo "<script>var store=false;</script>";
        }
    </php>
    <script>
        var href="{:cmf_url('shop/index/get_store_list')}";
        var shore_id='{$store_id}';
    </script>
    <script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/js/layer/mobile/layer.js"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=OabQI9tXEQtkhwgyuhVSPjUTwdggzA3Y"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/js/index_store.js"></script>
</div>
<div id="content2" style="display: none">
    <header>
        <div class="content" style="border-bottom: 1px solid #d7d7d75e;">
            <a href="javascript:;" onclick="get_store(2)"></a>
            <a>切换店铺</a>
            <a href="javascript:;"></a>
        </div>
    </header>
    <div class="now">
        <div>当前位置</div>
        <div><span>{$store_info.store_name}</span><span id="d_store">0m</span></div>
    </div>
    <div class="near">
        <div class="shoptitle">附近店铺</div>

    </div>
</div>
<php>if($flag==1){</php>
<script>
    $(function () {
        layer.open({
            content: '尊敬的联盟商家，您已成功绑定店铺，是否前去查看？'
            ,btn: ['好的', '不要']
            ,yes: function(index){
                location.href='/user/group/index.html'
                layer.close(index);
            }
        });
    })
</script>
<php>}</php>
<php>if($flag==2){</php>
<script>
    $(function () {
        layer.open({
            content: '尊敬的联盟商家，您已成为联盟商家，无需再次扫码！'
            ,btn: ['好的', '关闭']
            ,yes: function(index){
                location.reload();
                layer.close(index);
            }
        });
    })
</script>
<php>}</php>
<php>if($flag==3){</php>
<script>
    $(function () {
        layer.open({
            content: '恭喜你成为异业联盟商家，请在我的页面-推荐二维码推荐会员即可'
            ,btn: ['查看', '关闭']
            ,yes: function(index){
                location.href='/user/profile/qrcode.html'
                layer.close(index);
            }
        });
    })
</script>
<php>}</php>
<script>
    layui.use('flow', function(){
        var flow = layui.flow;
        flow.load({
            elem: '#LAY_demo1'
            ,done: function(page, next){ //执行下一页的回调
                //数据插入
                $.ajax({
                    type : "post",
                    url : "/shop/index/get_shop_list.html",
                    async : true,
                    data : {
                        "page" : page
                    },
                    success : function(data) {
                        var lis = [];
                        console.log(data.data)
                        for(var i = 0; i < data.data.length; i++){
                            var d_url=data.data[i]['url'];
                            var img=data.data[i]['thumbnail'];
                            var post_price=data.data[i]['post_price'];
                            var post_score=data.data[i]['post_score'];
                            var post_title=data.data[i]['post_title'];
                            var html=' <div onclick="location.href=\''+d_url+'\'">\n' +
                                '                    <div class="shoplisticon"><img src="'+img+'"/></div>\n' +
                                '                    <p class="shop_title">'+post_title+'</p>\n' +
                                '                    <p>￥<span>'+post_price+'</span>+<span>'+post_score+'积分</span></p>\n' +
                                '                </div>';
                            lis.push(html)
                        }
                        next(lis.join(''), page < {$page}); //假设总页数为 10
                    }
                });


            }
        });
        //按屏加载图片
        flow.lazyimg({
            elem: '#LAY_demo1 img'
            ,scrollElem: '#LAY_demo1'
        });

    });
</script>
</body>
</html>
